import Layout from "@/layout/index.vue";
import type { RouteRecordRaw } from "vue-router";
import Close from "@/views/close/index.vue";

const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: "root",
    component: Layout,
    redirect: { name: "Chat" },
    children: [
      {
        path: "chat",
        name: "Chat",
        component: () => import("@/views/chat/index.vue"),
        meta: {
          title: "聊天",
          noCache: true
        }
      },
      {
        path: "file-download",
        name: "Download",
        component: () => import("@/views/download/index.vue"),
        meta: {
          title: "文件"
        }
      },
      {
        path: "tool",
        name: "Tool",
        component: () => import("@/views/tool/index.vue"),
        meta: {
          title: "工具箱",
          noCache: false
        }
      }
    ]
  },
  {
    path: "/close",
    name: "close",
    component: Close,
  }
];

export default routes;
